import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Solution {
    Map<Character, Integer> symbolValues = new HashMap<Character, Integer>() {{
        put('I', 1);
        put('V', 5);
        put('X', 10);
        put('L', 50);
        put('C', 100);
        put('D', 500);
        put('M', 1000);
    }};

    // 罗马数字转整数
    public int romanToInt(String s) {
        int ans = 0;
        int n = s.length();
        for (int i = 0; i < n; ++i) {
            int value = symbolValues.get(s.charAt(i));
            if (i < n - 1 && value < symbolValues.get(s.charAt(i + 1))) {
                ans -= value;
            } else {
                ans += value;
            }
        }
        return ans;
    }

    // 移除元素
    public int removeElement(int[] nums, int val) {
        int j = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != val) {
                nums[j] = nums[i];
                j++;
            }
        }
        return j;
    }
}
public class HomeWorkDay3 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        //String s = input.next();

        int[] nums = {2, 2, 3, 3, 4};
        int val = input.nextInt();

        Solution solution = new Solution();
        //System.out.println(solution.romanToInt(s));

        System.out.println(solution.removeElement(nums, val));
    }
}
